package com.iris.live.services.common.kpi;

/**
 * Created by DF on 11/25/2016
 */
public class KPIMetaData {
    public enum TYPE {INT, DOUBLE}

    private int type;  //1(累加统计，比如新增订单数): 2(率, 比如上牌率): 3(平均数,比如单车金融服务费):
    private String numerator;
    private String numeratorAlias;
    private String numeratorMemo;
    private TYPE numeratorType = TYPE.DOUBLE;

    private String denominator;
    private String denominatorAlias;
    private String denominatorMemo;
    private TYPE denominatorType = TYPE.DOUBLE;
    private TYPE resultType = TYPE.DOUBLE;

    public KPIMetaData() {
    }

    public KPIMetaData setNumerator(String numerator) {
        this.numerator = numerator;

        return this;
    }

    public String getNumeratorAlias() {
        return numeratorAlias == null ? this.numerator : numeratorAlias;
    }

    public KPIMetaData setDenominator(String denominator) {
        this.denominator = denominator;

        return this;
    }

    public KPIMetaData setNumeratorAlias(String numeratorAlias) {
        this.numeratorAlias = numeratorAlias;

        return this;
    }

    public String getDenominatorAlias() {
        return denominatorAlias == null ? this.denominator : denominatorAlias;
    }

    public KPIMetaData setDenominatorAlias(String denominatorAlias) {
        this.denominatorAlias = denominatorAlias;

        return this;
    }

    public TYPE getNumeratorType() {
        return numeratorType;
    }

    public KPIMetaData setNumeratorType(TYPE numeratorType) {
        this.numeratorType = numeratorType;

        return this;
    }

    public TYPE getDenominatorType() {
        return denominatorType;
    }

    public KPIMetaData setDenominatorType(TYPE denominatorType) {
        this.denominatorType = denominatorType;

        return this;
    }

    public TYPE getResultType() {
        return resultType;
    }

    public KPIMetaData setResultType(TYPE resultType) {
        this.resultType = resultType;

        return this;
    }

    public int getType() {
        return type;
    }

    public String getNumerator() {
        return numerator;
    }

    public String getDenominator() {
        return denominator;
    }

    public KPIMetaData setType(int type) {
        this.type = type;

        return this;
    }

    public String getNumeratorMemo() {
        return numeratorMemo;
    }

    public KPIMetaData setNumeratorMemo(String numeratorMemo) {
        this.numeratorMemo = numeratorMemo;

        return this;
    }

    public String getDenominatorMemo() {
        return denominatorMemo;
    }

    public KPIMetaData setDenominatorMemo(String denominatorMemo) {
        this.denominatorMemo = denominatorMemo;

        return this;
    }
}
